﻿<!--#include file="conn.asp"--> 
<%
dim menu
	sql = "select [id],[CName],[Cid] from [menu] where Use=1 order by Sort asc,id desc"
	menu = connexe(sql)
connclose()
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>漂泊驿站V0.0.1.6</title>
<style>
html,body,dl,dt,dd,ul,li,h1,h2,P,a,img {margin:0;padding:0;border:none;list-style:none;}
body {font: 12px 宋体;color:#333;background:#007AFF url(bg.jpg) repeat-y center 0;}
a {color:#666;text-decoration: none;}
a:hover {color:#C60;text-decoration: underline;}

.head {width:960px; overflow:hidden; margin:auto;}
.menu {width:960px;padding:6px 0 5px 0;background:#f00 url("Menu.jpg") no-repeat 0 0; margin:auto; display:table;}
	.menu ul {padding-left:5px;}
	.menu ul li {font-size:13px;font-weight:bold;float:left;position: relative;margin-right:3px;}
	.menu ul li a {color:#FFF;display:block;padding: 7px 12px 5px 12px;}
	.menu ul li a:hover {color:#C30;background-color:#FFF;text-decoration: none;}
	.menu ul li ul {position: absolute;visibility: hidden;border-top:#DDD 1px solid;padding:0;}
	.menu ul li ul li {font-size:12px;clear:both;margin:0;background:#F7FFE8;}
	.menu ul li ul li a {width: 120px;text-indent:20px;color: navy;padding:4px 0 0 0;font-weight:normal;border:#DDD 1px solid;border-top:none;background:url("jt1.gif") no-repeat 5px 4px;}
	.menu ul li ul li a:hover {color:#C30;background:#FC0 url("jt2.gif") no-repeat 5px 4px;}
	.menu ul li ul li ul {margin-top:-20px;}
</style>
</head>
<body>
<script type="text/javascript">
		var menuids=["treemenu1"] 
		function buildsubmenus_horizontal()
		{
				for (var i=0; i<menuids.length; i++)
				{
						var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
						for (var t=0; t<ultags.length; t++)
						{
								if (ultags[t].parentNode.parentNode.id==menuids[i])
								{
										ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px"
										ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
								}
								else
								{
										ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px"
										ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
								}
								ultags[t].parentNode.onmouseover=function()
								{
										this.getElementsByTagName("ul")[0].style.visibility="visible"
								}
								ultags[t].parentNode.onmouseout=function()
								{
										this.getElementsByTagName("ul")[0].style.visibility="hidden"
								}
						}
				}
	  }
		if (window.addEventListener)
		{
				window.addEventListener("load", buildsubmenus_horizontal, false)
		}
		else if (window.attachEvent)
		{
				window.attachEvent("onload", buildsubmenus_horizontal)
		}
</script>
    
<div class="menu"><%=Menutext(0)%></div>
</body>
</html>

<%
Public Function Menutext(byval typeid)
	dim ii,Temp
	if isarray(menu) = true Then
		for ii = 0 to ubound(menu,2)
			if menu(2,ii) = clng(typeid) Then
					Temp = Temp & "<li><a href=""list.asp?id="& menu(0,ii) &""">"& menu(1,ii) &"</a>"
					Temp = Temp & Menutext(menu(0,ii))
					Temp = Temp & "</li>" & vbcrlf
			end if
		next
		
		if Temp <> "" Then
			if clng(typeid) <> 0 Then 
				Menutext = "<ul>" & Temp &" </ul>"
			else
				Menutext = "<ul id=treemenu1><li><a href=""./"">漂泊驿站</a></li>" & Temp &" </ul>"
			End if
		end if
	end if
End Function
%>